package admintool.imp03_ui_components;

/**
 * 
 * @author Administrator
 */
public class MyCollection {
  private static Object[] defaultObjects = { };

  private Object[] objects;
  private int numObjects;

  /**
   * 
   * @param objects
   */
  public MyCollection(Object[] objects) {
    this.objects = objects;
    this.numObjects = objects.length;
  }
  
  /**
   * 
   */
  public MyCollection() {
    this(defaultObjects);
  }

  /**
   * 
   * @return
   */
  public Object[] getObjects() {
    return(objects);
  }

  /**
   * 
   * @param objectString
   * @return
   */
  public Object getObject(String objectString) {
    Object returnValue = null;

    for(Object o : objects){
        if(o.toString().equalsIgnoreCase(objectString)){
            returnValue = o;
            break;
        }
    }
    
    return returnValue;
  }
  
  /**
   * 
   * @return
   */
  public int getNumObjects() {
    return(numObjects);
  }
}